module.exports = {
  title: '在线文档SDK',
  description: '平台无关的文档操作SDK - 提供统一的API接口操作飞书、钉钉等在线文档服务',
  base: '/document-sdk/',

  head: [
    ['link', { rel: 'icon', href: '/favicon.ico' }],
    ['meta', { name: 'theme-color', content: '#3eaf7c' }],
    ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
    ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }]
  ],

  themeConfig: {
    logo: '/logo.png',
    repo: 'srmt/document-sdk',
    editLinks: true,
    docsDir: 'docs',
    editLinkText: '在 GitHub 上编辑此页',
    lastUpdated: '上次更新',

    nav: [
      { text: 'Learn', link: '/1-learn/' },
      { text: 'Guide', link: '/2-guide/' },
      { text: 'API Reference', link: '/3-reference/' },
      { text: 'Configuration', link: '/4-configuration/' },
      {
        text: 'More',
        ariaLabel: '更多资源',
        items: [
          { text: 'Architecture', link: '/5-architecture/' },
          { text: 'Advanced Topics', link: '/6-advanced/' },
          { text: 'Development', link: '/7-development/' },
          { text: 'Troubleshooting', link: '/troubleshooting/' },
          { text: 'GitHub', link: 'https://github.com/srmt/document-sdk' }
        ]
      }
    ],

    sidebar: {
      '/1-learn/': [
        {
          title: 'Learn - 学习',
          collapsable: false,
          children: [
            '',
            'installation',
            'getting-started',
            'basic-concepts'
          ]
        }
      ],

      '/2-guide/': [
        {
          title: 'Guide - 使用指南',
          collapsable: false,
          children: [
            '',
            'document-management',
            'content-operations',
            'table-operations',
            'user-service',
            'permission-management'
          ]
        }
      ],

      '/3-reference/': [
        {
          title: 'API Reference - API参考',
          collapsable: false,
          children: [
            '',
            'document-service',
            'content-writer',
            'content-reader',
            'document-manager',
            'user-resolver'
          ]
        }
      ],

      '/4-configuration/': [
        {
          title: 'Configuration - 配置参考',
          collapsable: false,
          children: [
            '',
            'core-config',
            'spring-boot-config',
            'rate-limit-config'
          ]
        }
      ],

      '/5-architecture/': [
        {
          title: 'Architecture - 架构设计',
          collapsable: false,
          children: [
            'architecture-overview',
            'core-design',
            'table-system',
            'rate-limiting'
          ]
        }
      ],

      '/6-advanced/': [
        {
          title: 'Advanced - 高级主题',
          collapsable: false,
          children: [
            '',
            'spring-boot',
            'custom-rate-limiter',
            'extending-sdk'
          ]
        }
      ],

      '/7-development/': [
        {
          title: 'Development - 开发指南',
          collapsable: false,
          children: [
            '',
            'testing',
            'best-practices',
            'contributing'
          ]
        }
      ],

      '/troubleshooting/': [
        {
          title: 'Troubleshooting - 故障排查',
          collapsable: false,
          children: [
            '',
            'common-issues',
            'error-codes',
            'faq'
          ]
        }
      ],

      // 默认侧边栏
      '/': [
        {
          title: 'Learn - 快速开始',
          collapsable: false,
          children: [
            '1-learn/installation',
            '1-learn/getting-started',
            '1-learn/basic-concepts'
          ]
        },
        {
          title: 'Guide - 核心功能',
          collapsable: false,
          children: [
            '2-guide/document-management',
            '2-guide/content-operations',
            '2-guide/table-operations'
          ]
        }
      ]
    }
  },

  plugins: [
    '@vuepress/plugin-back-to-top',
    '@vuepress/plugin-medium-zoom',
    [
      '@vuepress/search',
      {
        searchMaxSuggestions: 10
      }
    ],
    [
      '@vuepress/google-analytics',
      {
        'ga': 'UA-XXXXXXXXX-X' // 替换为你的GA ID
      }
    ]
  ]
}
